﻿// Fill out your copyright notice in the Description page of Project Settings.


#include "DesignPatterns/SingletonPattern.h"
USingletonObject* USingletonObject::SingletonObject = nullptr;

USingletonObject* USingletonObject::GetSingletonObjectIns()
{
	if (SingletonObject == nullptr)
	{
		SingletonObject = NewObject<USingletonObject>();
	}
	return SingletonObject;
}

void USingletonObject::SetValue(int32 NewValue)
{
	IntValue = NewValue;
}

int32 USingletonObject::GetValue()
{
	// UE_LOG(LogTemp, Warning, TEXT(__FUNCTION__" Value = %d"), IntValue);
	return IntValue;
}
